package day19.pack7;

import java.util.concurrent.atomic.AtomicInteger;

public class Station {
    private int count = 100;

    public synchronized void sell() {
        if (count > 0) {
            System.out.println("销售座位" + count-- + ",该票出售给了：" + Thread.currentThread().getName());
        } else {
            System.out.println("抱歉，剩余票数为：" + count + ",当前线程为：" + Thread.currentThread().getName());
        }
    }
}
